home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
xed11b.zip
/
XED.DOC
< prev
next >
Wrap
Text File
|
1994-08-24
|
61KB
|
1,546 lines
XED version 1.1b heX EDitor
A Unique Hexadecimal/Binary file editor
(c) Copyright 1993-94 David L. Dight
All Rights Reserved.
P.O. Box 280, Kings Cross, N.S.W. 2011 AUSTRALIA
Fax: +61 2 233 2929, On CompuServe:100033,2563
or the Internet davidd@interconnect.com.au
-+-
User's Guide
Revision 1.1.b.2 24-Aug-1994.
-+-
Contents
========
Chapter 1. XED - an overview.
Chapter 2. Features
a) Unlimited file size
b) Modify file length
c) Mouse support
d) EGA/VGA alternate screen modes
e) Undo and Undo all
f) Edit entire paragraphs as strings
g) Bitwise and binary
h) Create compiler readable data definitions
i) Online help, ASCII tables and Text filters
j) Multiple markers
k) Unassembler
l) Search and Replace
m) Additional functions
Chapter 3. Command line
Chapter 4. Movement
Chapter 5. Editing
Chapter 6. Other functions and notes
a) Searching
b) Goto offset
c) Save
d) Insert paragraph
e) Copy paragraph
f) Delete paragraph
g) Seven/Eight bit ASCII
h) File information
i) DOS shell
j) Quit
k) Help menu
l) Bitwise operations
m) Binary display/edit
n) Assignment expressions
o) Fonts
p) C data definition creation
q) ASCII tables
r) Text filters
s) Using markers
t) Using the unassembler
u) Search and Replace
v) Defragmenting the edit buffer
Chapter 7. Additional Functions in the Registered Version
a) Global search and replace
b) Goto next/previous change
c) Change video mode
d) Edit multiple files
e) Import file
f) Save file to a different or new file name
g) Translate values
h) Expert mode on/off
i) Backup flag on/off
j) Read only on/off
k) Sound on/off
l) Upper case hex on/off
m) Hidden characters on/off
n) Toggle mouse jump
o) Change the Border Colour
Chapter 8. Program Environment and known limitations.
Appendix A. Keyboard Summary
Appendix B. Notes, Disclaimer
-+-
Chapter 1. XED - an overview.
=============================
XED is a simple to use hex file editor. XED permits binary files
to be edited in much the same way as normal text files. Files
are initially viewed as containing (bytes/16) paragraphs. Bytes
from these paragraphs are presented on the screen as hex digits
to left, and as ASCII characters to the right. In this document,
the meaning of "line" and "paragraph" will be the same.
Typical uses include repair of backup file headers; editing of
string constants in executables; creation or expansion of binary
data files or any other situations which require low-level
modification to a file.
Unlike many other hex editors, XED is not restricted to editing
the file as it appears on the disk. The file is viewed as a
stream of binary characters. This allows you to edit and change
any binary file. The only restriction to the size of the edited
file is your hard disk capacity.
XED starts in hex mode. To toggle over to the ASCII window,
press the TAB key. The cursor may be moved with the normal
cursor/page keys. A simple reverse video block selects the
current byte which may be edited on screen. You may also edit an
entire paragraph by pressing the INS key. If you are in ASCII
mode, the current paragraph can be edited as a string. In hex
mode, XED converts the paragraph into a hex string (2 hex digits
per byte). The length of the paragraph can be increased or
decreased.
To search, press Shift+F8. Depending on the mode you are in, XED
will prompt for a hex or an ASCII string. F8 repeats the last
search.
To move to specific offset press F9. Offsets can be entered in
decimal, hex or octal.
F4 will save the current file to disk and by default, create a
backup copy of your original file.
-+-
Chapter 2. Features.
====================
2.a) Unlimited file size
XED can edit files as big as your disk storage permits. By
default, XED will use extended memory. If that is
unavailable or full, expanded memory will be used. If again
this is unavailable or full, XED will use the TMP or TEMP
environment variable to locate the drive and directory to
store the file buffer on disk. For small files the hard-disk
will never be required. However for larger files, this will
be used. (A note: if you use a ramdisk and have your TMP
variable set to that drive, make sure you set the TMP
variable to your hard disk. XED will need about two to three
times the size of the file in bytes for buffer storage on
the disk).
2.b) Modify file length
XED permits bytes to be inserted or deleted from any binary
file. This means that executable files, hidden files and
device files can be modified. Of course, you should know
what it is you are editing before attempting to do so. A
typical example may be to repair/insert a header in a
corrupted backup file. Blank paragraphs and paragraph copies
can also be inserted. XED displays a '+' next to any
paragraph that is longer than 16 bytes, and a '-' next to
paragraphs less than 16 bytes.
2.c) Mouse support
XED can be used with a mouse. You can click on bytes to
edit; scroll the edit window; select paragraphs to be edited
and select commands from a menu. The use of a mouse is
recommended.
2.d) EGA/VGA alternate screen modes
XED will default to the 25 line display. If you have an EGA,
you can also use the 43 line display mode. If you have a
VGA, 28, 43 or 50 line modes are also available. See the -l
option.
2.e) Undo and Undo all
When a paragraph has been modified, XED retains the original
contents. The paragraph may then be undone at anytime by
pressing Alt+U. All paragraphs that have changed can be
undone as well by pressing Alt+A. XED displays a '!' next to
any paragraph that has changed.
2.f) Edit entire paragraphs as strings
An entire paragraph can be edited as an ASCII string or as
an ASCII string of hex digits. This permits the insertion or
deletion or modification of any paragraph, with any
character. The normal inline editing functions are fully
supported. Any ASCII character that is used by XED (eg.
TAB) can be entered in hex mode.
2.g) Bitwise, binary and assignment expressions
XED supports a number of bitwise operations when in hex mode,
eg. shift, rotate and 1's complement. The current byte can
be viewed and edited in binary (see Editing/binary display).
Simple assignment expressions can be executed on the current
byte. For example, the following expression can be entered to
switch off the first 3 bits:
[<offset>] &= ~0x7
XED supports the full set of 'C' assignment operators plus a
few non 'C' operators. See Section 6.n.
2.h) Create compiler readable data definitions
It is often necessary to convert a binary file into a compiler
readable format. This usually requires a program to be created
to do the task. XED can do this for you by creating 'C' data
definitions from any file.
2.i) Online help, ASCII tables and Text filters
Various help screens are available within XED depending on the
situation. A Dec/Hex/Oct/Bin/ASCII table is also provided. An
additional feature in these tables displays individual charac-
ter counts for the current file.
XED allows you to view the current file through three
different text filters, which permits easier comprehension of
data in particular editing situations.
2.j) Multiple markers
XED permits up to 39 file markers to be set within the current
file. A mark list window is also available for quicker mark
retrieval. Multiple markers can be very useful if you are
working on a number of different offsets within the file. The
mark list permits easy viewing and retrieval of your marks.
2.k) Unassembler
XED permits data to unassembled for viewing. A feature of this
capability allows you to align starting byte offsets to decode
various instructions correctly. The 80x86 family opcodes are
fully supported including true 32 bit, floating point 80x87
and emulated instructions.
2.l) Search and Replace
A limited or global replace can be made to a file with either
hex bytes or an ASCII string.
2.m) Additional functions
After the application of your validation key sent to you when
you register, additional functions will become available
including: 2...n (global) search and replace; import file;
translate to number function; select alternate video modes;
edit multiple files and more.
-+-
Chapter 3. Command line.
========================
XED accepts the name of the file to edit or a valid DOS
wildcard plus a number of switchable options.
An optional response file can be specified. A response file
is simply a text file containing a list of switches
(including a filename). To specify a response file, prefix
the response filename with the at '@' character, for example:
xed @myopts
You can debug your response file switches by appending the -h
switch to the parameter list. XED will respond with the help
message, with your correctly parsed switches and or values
listed in the respective switch 'default' values.
If no file or response file is given, XED will search for the
default response file "XED.RSP". If this file is present in
the current directory, it will be read.
Response files provide a way of configuring XED yet still
permit different files to be edited. For example, the default
response file could contain your display or backup options or
other switches you may need, but not the filename. XED will
then read the response file and prompt for the file to edit.
The switches are summarised below:
usage: XED [-abdefghijlmnprstuvx7?!] <[@]file>...
-a start in ASCII mode, default False
-b make Backup before save, default True
-d force Disk based virtual memory, default False
-e Expert mode, default False
-f use system Font, default False
-g show system characters, default False
-h(help) print this Help message, default True
-i Ignore machine test, default False
-j enable mouse Jump ("snapto"), default True
-l <set screen Lines [25 28 43 50]>, default 25
-m Mono screen, default False
-n biNary display, default False
-p disable Pointing device, default False
-r Read only, default False
-s enable Sound, default True
-t <start in Text filter#>, default 1
-u Display hex bytes using Upper case, default False
-v <resident Virtual memory (Kb)>, default 128
-x <eXecute DOS command on startup>
-7 start with 7 bit ASCII display, default False
-? print Usage message, default False
-! about XED
Notes.
Switches that do not require a parameter can be 'stacked'
together on one switch (which can be a '-' or a '/'). The last
switch stacked can also be a switch that takes a parameter for
example:
xed -p -f -a -l28 -d myfile.bin
can be regrouped and passed as follows:
xed myfile.bin -pfadl28
The file name can appear any where on the command line. If a
file is not specified, XED will prompt for the filename.
Similarly, if a switch that requires a parameter is given
without the parameter, XED will prompt you for it. If the
filename is omitted, XED will prompt for it last. If you use
this method to specify a file you cannot use wildcards.
Notes about each switch follows:
-a XED defaults to hex mode on startup. Use this switch to
start in ASCII mode.
-b By default, XED creates a backup of any file that has
been saved, in the directory where the file resides.
Use this switch to disable backup creation.
-d Forces XED to use the disk only for buffering. This may
be necessary if your extended/expanded memory is not
large enough to hold the file buffer. XED will normally
detect this situation anyway. Use this switch if you
still experience problems.
-e Disables yes/no prompts with non-trivial operations.
-f Disable internal font. XED reprograms the video
controller to use a different text font. Use this
switch if characters appear corrupted. CGA and certain
EGA adaptors will need this switch. You may also select
this option if you are examining files that use some of
the redefined font characters.
-g By default, XED uses 32 characters in the font table for
system purposes. These are not displayed. This option
forces XED to display these characters.
-h Prints a switch summary with switch descriptions.
-i XED will only run on PC/AT or greater (386's and
greater are of course ok). XED will test your machine
to see if it conforms. On some early systems, machine
ID's may not be recognised. If this is the case, and your
system is a 286 or greater, use this switch.
-j By default, the mouse cursor will jump to the exit button
in most windows or to the scroll characters in the text
filter and ASCII tables. After leaving a window, XED will
move the cursor to the position it was prior to executing
the command. To disable this, use this switch.
-l<n> If you have an EGA, you can use 43 line mode (eg -l43).
With VGAs, you can choose from 28, 43 or 50 line modes.
-m Force monochrome display attributes.
-n When the binary display flag is set, the currently selec-
ted byte will be displayed in binary at the far left of
the screen (replacing the paragraph offset), see F5.
-p XED will use the mouse by default if present. The mouse
can be disabled with this switch.
-r The current file cannot be written (read only).
-s XED uses bleeps when issuing warning messages. These
can be disabled with this switch.
-t<n> This switch will force XED to enter the text filter wind-
ow number n (1-3) on starting.
-u By default, XED displays hex digits (A-F) in lower case.
This switch forces upper case. Hex offsets are always
displayed using upper case.
-v<n> By default, XED will use 128Kb of DOS memory for the
virtual heapspace. This can be adjusted to suit your
memory availability (maximum value is 640).
-x<s> Execute DOS command on startup. The command string can
contain parameters as along as the entire string is
enclosed in double quotes.
-7 By default, XED displays the full 8 bit ASCII character
set. This switch selects 7 bit display.
-? Print a short usage message.
-! Print the About XED message.
Return value
------------
XED will return the following values to DOS:
0 - normal exit, no error.
1 - either the file was not found or the response
file was not found.
2 - XED couldn't initialise the argument parser.
3 - the executable XED.EXE is corrupt.
4 - insufficient memory to execute.
5 - XED couldn't initialise virtual memory.
+6 - _vm_errors + 5 if any.
!! if you are interested in the command line argument parsing
routine used in XED, please contact me on CompuServe or on
the Internet and I will upload it to you. The routines are
written in C++ and are a collection of argument parsing
objects. Compiles in DOS/UNIX.
-+-
Chapter 4. Movement.
====================
The cursor keys will locate the software cursor anywhere on
the screen in either hex or ASCII modes. The screen will
scroll one page at a time if up or down are pressed on the
first or last lines respectively. HOME/END moves to the
first and last byte on the current paragraph. PGUP/PGDN move
one page, Ctrl+PGUP/PGDN will move 10 pages. Ctrl+HOME and
Ctrl+END will move to the first and last paragraph.
If you are using the mouse, the scroll bar to the right of
the screen supports mouse activated movement. If you click
on the top or bottom arrows, XED will execute a PGUP/PGDN.
If you hold the button down, XED will continue to page. If
you click anywhere on the bar, XED will move to the
approximate position relative to the whole file. If you
click on the bar position just below the top arrow or just
above the bottom arrow, XED will execute a Ctrl+HOME or
Ctrl+END.
The relative offset block in the scroll bar can be moved by
clicking the left button on the relative position in the
scroll bar.
The UP/DOWN arrows will scroll the page on the window limits.
-+-
Chapter 5. Editing.
===================
A reverse video software cursor points to the current
offset. The offset is displayed in both hex and decimal at
the top right of the screen. Moving the cursor or page keys
will relocate the cursor. If you are using the mouse, you
can click on any byte to relocate the cursor (if you are in
hex mode you can click on a byte in the ASCII window - and
vice-versa). Press TAB to toggle between the ASCII and hex
windows.
In hex mode, you can enter hex digits directly at the cursor
and in ASCII, normal ASCII characters can be entered. XED
will move the cursor to the right after a valid entry. To
save the changes you have made to the current paragraph, you
must press ENTER. XED will tag the current paragraph with a
'!'.
If the current paragraph has changed but has not yet been
committed (i.e. ENTER has not been pressed), XED will display
a '' to left of the Hex display.
When in Hex mode, the following bitwise operations are recogn-
ized:
press < to shift left by 1 bit
" L " rotate left by 1 bit
" > " shift right by 1 bit
" R " rotate right by 1 bit
" + " increment
" - " decrement
" ~ " bitwise NOT (1's complement)
" ` " negate (2's complement)
These keys operate on the currently selected byte.
As with any edit, you must press ENTER before moving off the
line to keep your changes.
When in Hex mode, the current byte can be edited in binary
mode by pressing Shift+F5. (You must first select binary
display mode by pressing F5 if you are not in this mode). If
you are using the mouse, you can click on the binary display
at the left of the screen to edit in binary.
The cursor will move to the far left of the screen where the
byte is displayed. You may move the cursor to any bit and
enter a 1 or a 0. The bitwise operator keys described above
are also active. Mouse users can also toggle individual bits
on or off by clicking on any bit. To save the byte, press
ENTER (or click the right button). This will exit from binary
mode and take you back to Hex mode. To save any binary edits
you must press ENTER again before leaving the line. To abort
binary editing, press ESCAPE.
'C' like assignment expressions can be executed by pressing
F6. After entering the expression, XED will update the
current byte with the result. Press ENTER to accept the
changes. See section 6.n below for more details.
To edit an entire paragraph, press INS. If you are in hex
mode, the current paragraph will be translated into an ASCII
string of two digit hex bytes. This string can then be
edited on the bottom line of the screen. XED recognises the
usual in-line editing keys (such as DEL, INS, HOME, END,
LEFT, RIGHT, BACKSPACE, and so on). In ASCII mode, the
string is presented for editing on the last line. For inline
editing help, press F1 (or click on the '?').
Up to 80 ASCII or 40 hex bytes can be inserted or deleted
per paragraph. When in hex mode, two hex digits are needed
for each byte - bytes that require one hex digit only must be
entered with a leading '0'. To save changes you have made to
the current paragraph, you must press ENTER. To abort, press
ESCAPE. XED displays a '+' if the paragraph is greater than
16 bytes, and '-' if it is less. The new length of the
paragraph is printed on the bottom line.
If you are using the mouse, you can click on the paragraph
offset at the left of the screen to edit that paragraph. The
cursor can be located within the string using the mouse.
You may return to an edited paragraph and restore it's
original contents by pressing Alt+U. If you then
subsequently re-edit the paragraph, XED will retain the
previously edited paragraph in the undo buffer. This means
you can still lose the original contents! (of course you
don't have to save the file).
Inline editing is available on any operation that takes the
cursor to the bottom line (this includes whole paragraph
edits, search specs and goto offset). Apart from the normal
cursor keys, backspace and INS/DEL, XED recognises Alt+D
(delete to end of line) and F3 (get last edited string).
All changes can be undone by pressing Alt+A. Unfortunately,
this will NOT undo whole paragraph insertions or deletions.
Press F1 for help or click on the '?' on the top line. The
help screen can also be used as a menu. Any command can be
entered or clicked on from the menu to execute.
If you click on the filename, XED will execute F10 file info
function. If you click on the two shutter characters at the
top left. XED will exit.
When in any edit mode, if the mouse location when the left
button is clicked is not valid, the left button will execute
an ESCAPE. The mouse buttons default to ESCAPE for the left
button and ENTER for the right button.
-+-
Chapter 6. Other functions and notes.
=====================================
6.a) Searching <F8, Shift+F8>
To search for a string or byte, press Shift+F8. In ASCII
mode, you can enter an ASCII string on the bottom line. In
hex mode, you can enter one or more hex digits. To search
again, press F8. You can interrupt a search by pressing
ESCAPE.
To automatically mark the search find, press Ctrl+F8 instead
of F8. In this way you can record search finds for later
review.
The replace function (see 6.u below) will use the last valid
search string to search.
6.b) Goto offset <F9>
To goto an offset, press F9. XED will prompt you to enter an
offset. You can enter the value in Decimal, Hex or Octal, for
example:
285053 (dec)
0x4597D (hex)
01054575 (oct)
You can also goto a mark by entering the desired mark number
prefixed with a '%'.
6.c) Save <F4>
To save the current file press F4. XED will create a backup
of the current file by default. To disable this, start XED
with the -b switch (see above).
6.d) Insert paragraph <F2, Ctrl+F2>
F2 will insert a blank paragraph (16 bytes - all nulls)
below the current paragraph. Use this to insert data. The
length of the new paragraph can be modified by editing (see
INS above). By default XED will prompt you to confirm any
editing function such as insert paragraph. XED will NOT
prompt in expert mode.
Ctrl+F2 will insert above the current paragraph.
6.e) Copy paragraph <F3, Ctrl+F3>
F3 will copy and insert the current paragraph below. To copy
any one paragraph to any other, edit the source paragraph
(INS), press ESC, move to the target, press INS then F3. The
paragraph should now show the copied values. Press Enter to
save the change.
Ctrl+F3 will copy and insert above the current paragraph.
6.f) Delete paragraph <Shift+F2>
Shift+F2 will delete the current paragraph regardless of
whether it has been expanded or shortened. XED will NOT
prompt in expert mode.
6.g) Seven/Eight bit ASCII <F7>
By default, XED will display ASCII characters (in the ASCII
window) as 8 bit characters. To toggle between 7 and 8 bit,
press F7. Some of the low order ASCII characters and all the
high bit characters will displayed as a period '.'
6.h) File information <F10>
To obtain information about the current file, press F10. XED
will display the file size (both on disk - in bytes and
paragraphs, and edit size in bytes), the time/date of last
modification, any attributes (A=archive H=hidden S=system
R=read-only) and the number of changes (if any). A change is
any change to one paragraph. Also calculated and displayed
is the file CRC32 and the free disk buffer space.
Mouse users can click on the filename on the first line of
the screen to execute this command.
6.i) DOS shell <Alt+X>
To start a DOS shell press Alt+X. XED will swap itself out
to expanded/extended memory or to disk if necessary.
6.j) Quit <ESC, Shift+F4>
To exit press ESCAPE. XED will prompt you to confirm. If you
are in expert mode, XED WILL NOT PROMPT, EVEN IF THE FILE
HAS CHANGED. Mouse users can click on the button at the
top left of the screen to execute this command. Note: the
right mouse button defaults to ENTER when in XED and can
therefore be used for confirmations. Shift+F4 also quits XED.
You can abort while XED is loading a file by pressing 'q'.
6.k) Help menu <F1>
Press F1 for the help screen. Mouse users can click on the
question mark on the top line of the screen. The help screen
also doubles as a simple menu. Any command can be entered
from the menu. PGUP/PGDN move between the two help screens.
Mouse users can click on any character within a command
to execute that command.
6.l) Bitwise operations
These are available only in Hex and Binary edit modes. See
Section 5 for more details. To edit in binary, you must first
select binary display mode by pressing F5.
6.m) Binary display and edit <F5, Shift+F5>
F5 toggles the binary display. When on, the currently
selected byte will be displayed in binary at the far left of
the screen (replacing the current paragraph offset). To edit
the current byte in binary, press Shift+F5 or click on the
binary displayed byte. Mouse users can click on individual
bits in the byte which will toggle the bit on or off.
6.n) Assignment expressions <F6>
To enter an assignment expression, press F6. XED will convert
the current byte to a simple assignment expression, in the
form:
[<offset>] = 0x<hex byte>
for example:
[4CD0] = 0xe7
You can only edit the operator and value parts of the
expression, which is printed on the bottom line for editing.
Use the cursor keys, backspace, etc, to edit the expression.
You may enter any of the standard 'C' assignment operators.
The right value (rval) must be an integer constant, in the
form:
0x?? hex digit(s) (eg. 0xF6, 0x7)
0??? octal digit(s) (eg. 045)
????? decimal digit(s) (eg. 45)
????????b binary digit(s) (eg. 10101010b, 1100b)
and no subexpressions or parentheses are recognised.
The following 'C' assignment operators are recognised:
a = b simple assignment
a += b plus equals (a = a + b)
a -= b minus equals (a = a - b)
a *= b times equals (a = a * b)
a /= b divide equals (a = a / b)
a &= b bitwise AND equals (a = a & b)
a |= b bitwise OR equals (a = a | b)
a ^= b bitwise XOR equals (a = a ^ b)
a %= b modulus equals (a = a % b)
a <<= b left shift equals (a = a << b)
a >>= b right shift equals (a = a >> b)
a <op> ~<b> 1's complement
and the following non 'C' assignment operators:
a l= b left rotate equals (lrot (a, b))
a r= b right rotate equals (rrot (a, b))
a <op> `<b> 2's complement
The 1's '~' complement operator is also recognised. This can
precede any rval, to 'NOT' the value before assignment. A 2's
complement operator is also available, '`'. This is used in
the same way as the 1's complement operator, and returns the
1's complement plus 1 (the same as the 'C' '-' unary minus
(sign change) operator).
When editing an expression, you can view a summary of the
expression types by pressing F1 (or click on the '?').
Examples:
[<offset>] |= 0x3 (switch on bits 0-1)
[<offset>] &= ~0x3 (switch off bits 0-1)
[<offset>] *= 10 multiply by 10 (dec)
[<offset>] += 1 increment
[<offset>] <<= 3 shift left 3 bits
[<offset>] l= 3 rotate left 3 bits
[<offset>] ^= 10011b xor with 0x13
[<offset>] = `111b assign 2's complement of 111b
(=0xF9)
[<offset>] >>= `0376 right shift by the 2's
complement of octal 376 (0xfe)
(=0x2)
6.o) Fonts
XED reprograms the video controller to accommodate both the
use of special characters and to emulate the graphics mouse
cursor. Consequently, certain extended characters (eg. some
ruling graphics) will not be displayed in the ASCII window.
In their place, XED will display a small 'x'. In order to see
these characters, use the -g switch (see section 3).
To force XED to display the default character set, use the
following command line:
xed -pf <file>
which disables the mouse and uses the system font.
The following characters are reserved by the system:
0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92 0x93 0x94
0x95 0x9b 0x9f 0xc7 0xc9 0xcd 0xce 0xcf 0xd0
0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xdc
0xf6 0xf7 0xf8 0xff 0x00
6.p) C data definition creation <Ctrl+F4>
To create a 'C' data definition using the current file, press
Ctrl+F4. XED will create the definition to the current file-
name with a '.HEX' extension, as in the following example:
typedef struct
{
char paragraph[16];
}
PARAGRAPH;
PARAGRAPH untitled[] =
{
{ "\x4d\x5a\xa3\x01\x11\x00\x05\x00\x20\x00\xe1\x02\xff\xff\x5b\x04" },
{ "\x00\x08\x00\x00\x14\x01\x00\x00\x1e\x00\x00\x00\x01\x00\x22\x01" },
.
.
.
{ "\x4d\x5a\xa3" },
};
For example, if the current file is MYFILE.BIN, XED will
create the definition to the file MYFILE.HEX. The file can
then be included in your program as a header file.
Note: the data generated after compilation may cause an
overflow in the data segment if the data definition is too
large. Check that the data created will fit the target memory
model.
The text file produced will be approx. 4 to 5 times the size
of the binary file.
If the length of the last paragraph is not 16 bytes, the
definition will still compile to 16 bytes in length, padded
with nulls. You need to be aware of this. Some compilers may
require pragmas to align the data on 1 byte boundaries.
To assist you to incorporate the definitions generated into
your code, XED will also generate the following #define
statements:
#define FILESIZE <size of file in bytes>L
eg. #define FILESIZE 12389L
and:
#define PARAGRAPHS (sizeof(untitled)/sizeof(PARAGRAPH))
which corresponds to the number of 16 byte paragraphs defined.
If the last paragraph is not 16 bytes in length, the
following statement is also produced:
#define BYTES_ON_LAST <bytes on last paragraph>
eg. #define BYTES_ON_LAST 11
See the file COLOURS.HEX which is an example data definition
that was generated by XED. The program file MKBIN.C is an
example that uses the definition file to create an
executable file called COLOURS.COM.
Since the output is a text file, you can of course edit the
file and change the structure or data layout to suit your
needs.
Note: if you have altered the length of any paragraph, you
must execute a defragment <Alt+M> before executing this
command.
6.q) ASCII tables <Shift+F6>
To view the ASCII tables, press Shift+F6. XED will display
two columns of 13 bytes. Each byte is displayed in decimal,
hexadecimal, octal, binary and it's ASCII character. You can
page through the table with PGUP/PGDN. Mouse users can click
on the up/down arrows at the top right of the window. Press
HOME/END to go to the start/end of the table.
Note: the ASCII characters displayed will contain some chara-
cters used by XED, which are replaced with a small 'x'. See
6.o above.
To see the standard 3 character names for the first 32 chara-
cters, press F1. Mouse users can click on the word "Asc" to
toggle the name display.
F2 toggles the binary/character count fields. The character
counts are calculated when you run the file info command F10.
Mouse users can click on the words "Binary" or "Count" to
toggle the display.
Character counts can be useful when analysing a data or text
file. The counts shown will reflect changes made to the file.
To update the counters, press F10 then Shift+F6.
F3 will resort the table from lowest to highest character
frequencies. If you press F3 again, the table will resorted
back to the default ASCII order. Mouse users can click on the
words "Dec" to toggle the sort.
To exit, press ESCAPE.
6.r) Text filters <Shift+F7>
To view the current file through the text filter, press Shift
+F7. The current page is displayed as text lines in a window.
Extended and non-printable characters are shown as a '.' By
default, XED filters all characters below 0x20 (32 dec), only
displaying CR (0xd), LF (0xa), EOF (0x1a) and ESC (0x1b) by
their string names enclosed in angle brackets, eg <ESC>. To
view all the string names (for characters 1 - 32 only), press
F2. To view strictly text only press F2 again. F2 will cycle
through these three types of filter. Mouse users can click on
the filter number in the window title to execute F2.
The 1 to 32 character string name filter is useful for
viewing raw data packets or other communications data. To
save space, the name <NUL> (0) is not displayed since this
character is usually the most common in binary files.
XED displays the first character of each paragraph in bold,
allowing you to see the relative position of the text in the
file.
XED will display all characters from the current page and
possibly some or all characters from the next page (to fill
the text window). Characters from the next page are displayed
in GREY attribute.
You can scroll through the file with PGUP/PGDN. Mouse users
can click on the arrows at the top right of the text window.
Mouse users can click on any character in the window to go to
the byte. For this to work properly, select filter number 3.
To exit, press ESCAPE.
6.s) Using markers <Shift+F9, Ctrl+F9, F9>
To set a mark at the current offset, press Ctrl+F9. XED will
assign the next available mark from a list of 39. To remove
this mark or any mark, go to the marker and press Ctrl+F9
again. To retrieve a mark, press F9 (goto offset) and enter
the mark number prefixed with a '%', for example:
Enter offset: %3
will go to marker number 3. To view the mark list, press
Shift+F9. XED will display each mark slot with the offset and
hex byte at that offset in bold. Unused slots will display
'free'. Press ESCAPE to exit the list. Mouse users can click
on a marker to retrieve (goto) that mark.
When in the mark list window, you can press DEL to remove all
marks.
To retrieve the next mark, press Alt+F10. XED will go to the
next logical active mark (the next mark after the last
retrieved or set). To retrieve the previous mark, press
Ctrl+F10. This feature is useful when you wish to work at a
few different offsets. Set a mark at each offset then move
between them with these command keys.
6.t) Using the unassembler <Shift+F10>
The unassembler interprets the 80x86 and 80x87 family
instruction set in both 16 and 32 bit modes.
To unassemble the current file commencing at the current file
offset, press Shift+F10. XED will disassemble as much data as
is necessary to fill the window. PGUP and PGDN move the file
pointer one paragraph which, depending on the instructions
will decode to on average 10 lines. Ctrl+PGDN/PGUP will move
the file pointer one page (16 * (screen lines - 2)) bytes.
XED will display assembly lines whose offsets begin on a
paragraph boundary in bold attribute. This permits easier
reading of the mnemonics generated.
Clearly much of the data will not unassemble correctly. There
are a number of reasons for this:
a) The data are not opcodes - they may be program data
or perhaps packed/compressed values;
b) The unassembler has commenced disassembly at an odd
or incorrect offset;
c) The opcodes are co-processor/emulated instructions, or
d) The opcodes are invalid.
When the commencement offset is incorrect, the unassembler
will not resolve instruction sequences properly. To correct
this problem, press LEFT or RIGHT which will move the file
offset back or forward one byte. Alternatively, you can
press ESCAPE to exit the window, reposition the cursor and re
-enter the unassembler. You will often find the instructions
are now correct. This ability will permit disassembly of
packed or oddly aligned instructions. Mouse users can click
on the left/right arrows on the title line to realign.
Ctrl+LEFT will set the offset to the start of the paragraph
and Ctrl+RIGHT will set the offset to the end (0xf).
The title line of the window will display the current view
flags. These are:
toggle key on off
F2 '32' assume 32 bit code '16' assume 16 bit code
F3 'FP' use 80x87 instructions 'EM' use 80x87 emulator
F4 'NS' ignore operand sizes 'SZ' show operand sizes
eg. mov [0456],0076 eg. mov word ptr [0456],0076
F5 'ND' ignore jump distances 'UD' show jump distances
eg. call 4560:0076 eg. call far 4560:0076
To view 80x87 co-processor instructions (and not their emula-
tions - the default), press F3. To view 32 bit instructions,
press F2. To ignore byte/word pointer display, press F4. To
ignore the distance of calls/jumps, press F5. Mouse users can
click on the two letter flag tags on the title line to toggle
these flags.
Some instructions when expanded may not fit in the window.
This is usually due to the operand size/distance, eg.
jmp far word ptr es:[bx+56]
These lines will end in a small right hand arrow. To see the
entire instruction sequence, toggle the 'SZ' or 'UD' flags.
In 16 bit mode, offsets are displayed in the segmented form
segment:offset, from the start of the file. In 32 bit mode,
single (near) 32 bit values are displayed.
When the unassembler cannot interpret byte sequences, XED
will display the sequence followed by '<invalid>' and
then skip to the next byte(s). On a few rare occasions, the
unassembler may get confused and print rubbish, which should
be ignored. This is usually the result of multi-byte opcode
sequences when the second or subsequent bytes in the
expected sequence are invalid.
6.u) Search and Replace <Ctrl+F7>
To replace a string, move to the ASCII window. To replace hex
bytes move to the hex window. Press Ctrl+F7. XED will prompt
for a search string and then a replacement string. In this
version, the search and replace strings must be the same
length. Answer 'Y' to replace globally or enter the maximum
number of replacements to make (registered version only).
If you have inserted or deleted bytes from the edit buffer,
you must execute the defragment edit buffer command Alt+M
before executing a search and replace.
See section 6.v for details.
6.v) Defragmenting the edit buffer <Alt+M>
The ability to insert and delete bytes from any paragraph
presents some problems to other parts of the system. These
effects are most noticeable when executing a search.
The reason for these problems can be found in the way XED
views the file as 16 byte paragraphs. If data is inserted or
deleted, the effect is only on the edited paragraph. The rest
of the file remains unchanged (meaning that offsets do not
change to reflect the insertions or deletions). This means
that searches will possibly fail. Replaces could fail hard.
Another problem is that if you add bytes to the end of a
paragraph beyond 16 bytes, you can only view this data with
the text filter or when you edit the entire paragraph.
It therefore became necessary to provide a function that will
reorganise the buffer into 16 byte paragraphs.
To execute a buffer defragment, press Alt+M. If you are not
in expert mode, you will be prompted to confirm the command.
XED achieves this operation by recreating the edit buffer. To
do this, an additional amount of buffer space equivalent to
the currently allocated buffer is required. For example, if
you were editing a 1 Mb file, you would need 2-3 Mb buffer
space plus an additional 2-3 Mb.
For obvious reasons, a defragment cannot be undone. You will
also lose the existing undo buffer.
If you have inserted or deleted bytes to the edit buffer, you
MUST execute Alt+M before a search or search and replace.
-+-
Chapter 7. Additional Functions in the Registered Version.
==========================================================
After the application of your validation key sent to you when
you register, the following functions will become available:
7.a) Global search and replace <Ctrl+F7>
2...n replacements can be made to the current file. The
command can be interrupted by pressing ESCAPE.
7.b) Goto next/previous change <Alt+N/Alt+P>
This command moves the current file position to the next or
previous paragraph that has been modified. This is useful for
locating edits in a large file.
7.c) Change video mode <Alt+V>
Allows you to change video modes within XED. Alt+V cycles
through the 25, 28, 43 and 50 line displays. Shift+Alt+V
reverse cycles. EGA users can only move between 25 and 43
line modes.
7.d) Edit multiple files
You may specify multiple files to edit on the command line
using wildcards or actual file names. Up to 128 files may be
specified.
When you press ESC to exit XED, the next file in the list
will be opened. Shift+F3 will abort to the previous file in
the list. To abort and exit press Shift+F4.
7.e) Import file <Alt+I>
This command will prompt you to enter a valid file name. The
file will be read into the edit buffer at the current offset.
The file will be inserted before the current byte. If the
current offset is at the start of the paragraph, the file
will be inserted above the current paragraph.
After reading in the file, XED will restructure the edit
buffer. Consequently, this operation cannot be un-done and
the contents of the undo buffer will be lost.
There must be at least three times the size of the file to
read in available in the buffer space.
7.f) Save file to a different or new file name <F4, Ctrl+F4>
When you save a file <F4> or save a file as a 'C' data
definition <Ctrl+F4> the file name is presented for editing.
You may enter a different or new file name.
7.g) Translate values <Ctrl+F1>
This command interprets the next eight bytes starting at the
current offset, as the following types:
abbrev. type bytes value range
---------------------------------------------------------
uc unsigned char 1 0 to 255
us unsigned short 2 0 to 65,535
ul unsigned long 4 0 to 4,294,967,295
f float 4 3.4E ± 38 (7 digits)
d double 8 1.7E ± 308 (15 digits)
The translated values are printed on the bottom line,
using the abbreviations indicated in the table.
7.h) Expert mode on/off <Alt+E>
Permits Expert mode to be toggled within XED.
7.i) Backup flag on/off <Alt+F>
Permits the Backup flag to be toggled within XED.
7.j) Read only on/off <Alt+R>
Permits the Read only flag to be toggled within XED.
7.k) Sound on/off <Alt+S>
Permits Sound to be toggled within XED.
7.l) Upper case hex on/off <Alt+C>
Permits either upper or lower case display for hex digits A-F
(a-f) to be toggled within XED.
7.m) Hidden characters on/off <Alt+H>
Normally hidden characters can be displayed in the ASCII
window.
7.n) Toggle mouse jump <Alt+J>
By default, the mouse cursor will jump to the exit button in
most windows or to the scroll characters in the text filter
and ASCII tables. After leaving a window, XED will move the
cursor to the position it was prior to executing the command.
7.o) Change the Border Colour <Alt+B>
Cycles through the 64 border colours. Shift+Alt+B reverse
cycles. (0=no border).
-+-
Chapter 8. Program Environment.
===============================
XED stores each paragraph separately in a dynamic linked
list. Paragraphs are stored in virtual memory - some in DOS
memory, maybe some in extended/expanded memory and that
which doesn't fit in memory is buffered to disk. XED will
attempt to retain paragraphs that are 'near' the currently
selected paragraph by caching when necessary. Consequently,
operations local to the current paragraph will be quicker
than those at distant offsets and overall performance will be
contingent on the capabilities of individual hard drives.
Operations on large files (say 3Mb) that require XED to
traverse the entire buffer may take longer depending on the
speed of your hard drive. Large files will also take some
time to read into the buffer as XED reads the ENTIRE file
before editing can begin.
XED will use the TMP or TEMP environment variables to locate
the buffer file. This drive and directory must be able to
store at least 3 times the size of the file to edit. RAMDRIVE
users may need to reset this variable to their hard drive.
XED has been tested on file sizes exceeding 20Mb and has
performed with tolerable speed. Windows users please see the
files XED.ICO and XED.PIF files included with the release.
XED was written in MS C++ 7.00.
Known limitations
-----------------
a) Running under Windows
When run in a DOS shell, Windows may object to reading or
writing to the file you have specified. Check that you have
SHARE installed correctly.
To run XED in a window, you must disable the mouse and the
video reprogramming (xed -pf <file>) as the windows mouse
conflicts with XED.
b) UMB_DRVR driver conflict
If you use UMB_DRVR and you wish to use EMS/XMS with XED,
UMB_DRVR appears to conflict and cause lock-ups. To get
around this, specify disk-based buffering:
xed -d <file>
c) Virtual memory errors
If for any reason during the program's operation a virtual
memory error occurs, XED will display the following message:
<error count> _vm errors! Exit and check your TMP/TEMP spec
This error is generated when an attempt to allocate or free
a paragraph in virtual memory fails.
If this occurs, exit XED. As described above, your TMP spec
must have sufficient space to handle the edit buffer. Many
operations such as insert or defragment will use additional
buffer space which could take your TMP free space over it's
limit. A low error count would indicate this condition. A
larger count usually indicates that insufficient buffer space
exists to load the file.
Another possible cause of this error is if the DOS allocated
virtual heapspace is too small. Try increasing this value,
see -v switch.
Note: these errors represent serious problems. Unpredictable
results may arise from any subsequent editing operation. In
particular you should not attempt to write the current file.
-+-
Appendix A. Keyboard Summary.
=============================
Key Command
--- -------
UP DOWN LEFT RIGHT Position cursor
< > / L R Shift/Rotate left/right
-/+/~/` Dec/Inc/NOT/NEG byte
ESCAPE Quit, open next file (*)
ENTER Commit changes to paragraph
TAB Move to ASCII/HEX window
Alt+A Undo All
Alt+B Change Border Colour (*)
Alt+C Upper case hex on/off (*)
Alt+E Expert mode on/off (*)
Alt+F Backup flag on/off (*)
Alt+H Hidden characters on/off (*)
Alt+I Import file (*)
Alt+J Mouse jump on/off (*)
Alt+N/Alt+P Goto next/prev change (*)
Alt+R Read only on/off (*)
Alt+S Sound on/off (*)
Alt+U Undo paragraph
Alt+V Change video mode (*)
Alt+X DOS shell
INS Edit paragraph
PGDN/UP Next/Previous page
Ctrl+PGDN/UP Move +-10 pages
F1 Help/menu
Shift+F1 About XED
Ctrl+F1 Translate values (*)
F2 Insert paragraph below
Ctrl+F2 Insert paragraph above
Shift+F2 Delete paragraph
F3 Copy paragraph below
Ctrl+F3 Copy paragraph above
Shift+F3 Abort edit, open previous file (*)
F4 Save file
Ctrl+F4 Save file as 'C' data
F5 Binary display
Shift+F5 Binary edit
F6 Assignment expression
Shift+F6 ASCII tables
F7 Toggle 7/8 bit ASCII
Shift+F7 Text filters
Ctrl+F7 1...n(*) Search and Replace
F8 Search (again)
Shift+F8 Search for...
Ctrl+F8 Search and Set marker
F9 Goto mark or offset
Shift+F9 Mark list
Ctrl+F9 Set/Remove mark
F10 File Information
Shift+F10 Unassemble
Alt+F10 Goto Next mark
Ctrl+F10 Goto Previous mark
(*) indicates command is only available in the
registered version.
Inline editing keys
-------------------
Key Command
RIGHT / LEFT Next/Previous character
F3 Get last edited string (Hex/ASCII)
HOME Start of line
END End of line
INS Toggle insert mode
DEL/BS Delete character
Alt+D Erase to end of line
Alt+K Kill (erase) line, home cursor
ENTER Accept edits and exit
ESCAPE Abort edit
Keys used in various windows
----------------------------
a) Text filters <Shift+F7>
PGUP / PGDN Move to Next/Prev paragraph
HOME First paragraph
END Last paragraph
F2 Cycle through the three filter types
ESCAPE Exit filter
b) Unassembler <Shift+F10>
PGUP / PGDN Unassemble from Next/Prev paragraph
LEFT / RIGHT Unassemble from Prev/Next byte in paragraph
Ctrl+PGUP/DN Move to Next/Prev page
Ctrl+LEFT/RIGHT Unassemble from First/Last byte in paragraph
HOME Unassemble from First paragraph
END Unassemble from start of Last paragraph
F2 Toggle between 16/32 bit instructions
F3 Toggle between emulated/true '87 instructions
F4 Toggle size operand display
F5 Toggle distance operand display
ESCAPE Exit unassembler
c) ASCII tables <Shift+F6>
PGUP / PGDN Move to Next/Prev page
HOME First paragraph
END Last paragraph
F1 Toggle long character name display
F2 Toggle between binary and count display
F3 Sort by character count
ESCAPE Exit filter
d) Mark list <Shift+F9>
DEL Remove all marks
e) Miscellaneous
ESCAPE Interrupt scan in F10
" Interrupt Search/Search and Replace
" Interrupt undo all <Alt+A>
'q' Abort file load and exit
-+-
Appendix B. Notes, Disclaimer.
==============================
Users of XED v1.1b must accept this disclaimer of warranty:
"XED IS SUPPLIED AS IS. THE AUTHOR DISCLAIMS ALL WARRANTIES,
EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE
WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR ANY PURPOSE.
THE AUTHOR ASSUMES NO LIABILITY FOR DAMAGES, DIRECT OR
CONSEQUENTIAL, WHICH MAY RESULT FROM THE USE OF XED. GOOD
DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE
THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON
IT. THE USER MUST ASSUME THE ENTIRE RISK OF USING THE
PROGRAM. ANY LIABILITY OF THE AUTHOR WILL BE LIMITED
EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF THE
REGISTRATION FEE TO REGISTERED USERS."
XED is a "shareware program" and is provided at no charge to
the user for evaluation. Feel free to share it with your
friends, but please do not give it away altered or as part of
another system. The essence of "user-supported" software is
to provide personal computer users with quality software
without high prices, and yet to provide incentive for
programmers to continue to develop new products. If you find
this program useful and find that you are using XED and
continue to use XED after a reasonable trial period, PLEASE
make a registration payment of $15 to DAVID L.DIGHT.
Commercial users of XED must register and pay for their
copies of XED within 30 days of first use. Site-Licence
arrangements may be made by contacting DAVID L. DIGHT.
Anyone distributing XED for any kind of remuneration must
first contact DAVID L. DIGHT at the address below for
authorisation. This authorisation will be automatically
granted to distributors recognised by the Association of
Shareware Professionals <ASP> as adhering to it's guidelines
for shareware distributors, and such distributors may begin
offering XED immediately (However DAVID L. DIGHT must still
be advised so that the distributor can be kept up-to-date
with the latest version of XED). Please see the files LICENCE
.DOC and DISTRIB.DOC for more information.
-+-
_______
____|__ | (R)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
-+-